package com.cy.config;


import com.cy.controller.interceptor.DengluInterceptor;
import com.cy.controller.interceptor.VisitorInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class MyMvcConfig implements WebMvcConfigurer {


    /*//视图跳转
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/index").setViewName("denglu");
    }*/

    //配置拦截器执行
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new DengluInterceptor()).addPathPatterns("/show.html","/SellerAdmi.html","/Admi.html","/ShowCar.html");
        registry.addInterceptor(new VisitorInterceptor()).addPathPatterns("/SellerAdmi.html","/ShowCar.html");
    }



}
